﻿using System.ComponentModel;
using System.ComponentModel.Design;

namespace ServiceProviderPractice
{
    class ComponentContainer : Container
    {
        private readonly ServiceContainer serviceContainer = ServiceProvider.Instance;

        protected override object GetService(System.Type service)
        {
            var serviceObj = serviceContainer.GetService(service);
            if (serviceObj == null) return base.GetService(service);
            return serviceObj;
        }
    }
}
